<template>
  <div id="dz_market" class="page in" data-title>
    <div class="container backFFF">
      <header>
        <a href="javascript:void(0);" class="pa back" @click="nfgotome"></a>
        <p>市场预测表</p>
        <a   class="pa add" @click="ufgotoadd"></a>
      </header>

      <div class="market-wrap">
        <div class="market-ul">
          <div class="market-li" v-for="(item, index) in modellist" :key="index">
            
              <span class="icon market" :data-marketid="item.markte_id" @click="nfgotodetail">{{item.markte_time }}</span>
           
          </div>         
        </div>
      </div>

    </div>
  </div>
</template>


<script>
var mySelf;  
export default {
    data() {
      return {
        modellist:[],
      }
    },beforeCreate() {
			this.$myUtils.isLoginGotoPage();	
		},
    methods: {
      init:function() {
        	uni.showToast({
							title: '正在加载数据',
							icon:'loading',
							duration:1000
                        });   
        this.$myUtils.myRequest({
					url: '/Market/getList?user_id='+this.$myUtils.getStorage('userId'),
				}).then(res => {	       	 
          mySelf.modellist = res.data.data; 
          if (mySelf.modellist=='') {
            	return uni.showToast({
							title: '未找到符合条件的数据',
							icon:'info',
							duration:1000
                        });
          }
				

        })	
      },
      nfgotodetail: function(Ev){
         uni.navigateTo({
            url: '/pages/personal/marketdetail?id='+ Ev.currentTarget.dataset.marketid 
        });

      },
      ufgotoadd: function(Ev){
         uni.navigateTo({  
            url: '/pages/personal/marketadd'
        });

      },
      nfgotome:function(){     
          uni.redirectTo({  
            url: '/pages/personal/me'
          });
      }
       

      
    },
    mounted() {
      mySelf = this;
      this.init();
    },
}
</script>